/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package ucm;

import sql.Insert;

/**
 *
 * @author Vitamin
 */
public class NewAchievement {

    private static NewAchievement local;
    private String msg;
    private String data[];
    private String sql;
    
    public static NewAchievement getInstance(String tp)
    {
        if(local==null)
        {
            local=new NewAchievement();
            local.msg=tp;
        }
        else
        {
            local.msg=tp;
        }
        return local;
    }
    
    public String run()
    {
        data=msg.split(";");
        sql="INSERT INTO subjectachievement(student_id, course_id, teacher_id, mark, failed, marked_date) " +
                "VALUES('"+ data[0] +"', '"+ data[1] +"','"+ data[2] +"','"+ data[3] +"','"+ data[4] +"','"+ data[5] +"')";
        String tp=Insert.getInstance().insertValue(sql)+";02";
        return tp;
    }



}
